var needle = require('needle');
var mongoose = require('mongoose');
var imageHandler = require('../../service/imageHandler');
var redisManager = require('../redisManager')
var User = require('../user');
var DB = require('../../entity').DB;
var grid = mongoose.mongo.Grid(DB);

function test(){
    User.getUserById('', function(err, user){
        imageHandler.handleAndSave(user.headimg, {
            size: 64,
            quality: 80,
            name: user._id+'.jpg'
        }, function(err, data){
            if(err){
                console.log(err.message);
            }else{
                console.log('成功')
            }
        });
    })
}

test()